/**
 * Created by Generator on 2017/08/03
 */
package com.nmgmd.shequ.hospital.base.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import com.nmghr.base.jpa.annotation.ColumnComment;
import com.nmghr.base.jpa.entity.UUIDWithTimeEntity;
import com.nmghr.manager.rbac.entity.DictionaryEntity;
import javax.persistence.*;
import java.math.BigDecimal;

@Entity
@Table(name = "t_hos_stock")
@Data
@EqualsAndHashCode(callSuper = true)
public class StockEntity extends UUIDWithTimeEntity {
    @Column(name="bid", precision=18, scale=2)
    @ColumnComment(msg = "进价")
    private BigDecimal bid;

    @Column(name="retail_price", precision=18, scale=2)
    @ColumnComment(msg = "剩余药品零售价")
    private BigDecimal retailPrice;

    @Column(name="vip_price", precision=18, scale=2)
    @ColumnComment(msg = "剩余药品vip价钱")
    private BigDecimal vipPrice;

    @ColumnComment(msg = "付款方式")
    @ManyToOne
    @JoinColumn(name = "pay_type_id")
    private DictionaryEntity payType;

    @Column(name="payable", precision=18, scale=2)
    @ColumnComment(msg = "应付金额")
    private BigDecimal payable;

    @Column(name="pay_amount", precision=18, scale=2)
    @ColumnComment(msg = "实付金额")
    private BigDecimal payAmount;

    @Column(name="purchase_date")
    @ColumnComment(msg = "进货时间")
    private Long purchaseDate;

    @Column(name="expiration_day", precision=18, scale=0)
    @ColumnComment(msg = "保质天数")
    private BigDecimal expirationDay;

    @Column(name="exp_date")
    @ColumnComment(msg = "过期日期")
    private Long expDate;

    @Column(name="purchase_total", precision=18, scale=0)
    @ColumnComment(msg = "进货总数")
    private BigDecimal purchaseTotal;

    @Column(name="rest_total", precision=18, scale=0)
    @ColumnComment(msg = "剩余数量")
    private BigDecimal restTotal;

    @ColumnComment(msg = "药品")
    @ManyToOne
    @JoinColumn(name = "medicine_id")
    private MedicineEntity medicine;

}
